package com.smart.campus.school.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.AttendanceRuleMapper;
import com.smart.campus.school.domain.AttendanceRule;
import com.smart.campus.school.service.IAttendanceRuleService;
import com.smart.campus.common.core.text.Convert;

/**
 * 考勤规则Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-10-21
 */
@Service
public class AttendanceRuleServiceImpl implements IAttendanceRuleService 
{
    @Autowired
    private AttendanceRuleMapper attendanceRuleMapper;

    /**
     * 查询考勤规则
     * 
     * @param id 考勤规则ID
     * @return 考勤规则
     */
    @Override
    public AttendanceRule selectAttendanceRuleById(Long id)
    {
        return attendanceRuleMapper.selectAttendanceRuleById(id);
    }

    /**
     * 查询考勤规则列表
     * 
     * @param attendanceRule 考勤规则
     * @return 考勤规则
     */
    @Override
    public List<AttendanceRule> selectAttendanceRuleList(AttendanceRule attendanceRule)
    {
        return attendanceRuleMapper.selectAttendanceRuleList(attendanceRule);
    }

    /**
     * 新增考勤规则
     * 
     * @param attendanceRule 考勤规则
     * @return 结果
     */
    @Override
    public int insertAttendanceRule(AttendanceRule attendanceRule)
    {
        return attendanceRuleMapper.insertAttendanceRule(attendanceRule);
    }

    /**
     * 修改考勤规则
     * 
     * @param attendanceRule 考勤规则
     * @return 结果
     */
    @Override
    public int updateAttendanceRule(AttendanceRule attendanceRule)
    {
        return attendanceRuleMapper.updateAttendanceRule(attendanceRule);
    }

    /**
     * 删除考勤规则对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceRuleByIds(String ids)
    {
        return attendanceRuleMapper.deleteAttendanceRuleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤规则信息
     * 
     * @param id 考勤规则ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceRuleById(Long id)
    {
        return attendanceRuleMapper.deleteAttendanceRuleById(id);
    }
}
